<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<#include "/header.html">
			<script src="/gaokao-admin/statics/libs/FileSaver.js"></script>
			<script src="/gaokao-admin/statics/libs/jquery.wordexport.js"></script>
			<!-- 引入组件库 -->
			<style scoped="scoped">
				#echartContainer>canvas {
					position: absolute;
					top: 3rem;
				}
				
				body,
				html {
					width: 100%;
					height: 100%;
					background-color: rgb(249, 249, 249);
				}
				
				.title {
					margin: 20px 0px;
					padding: 0px;
					width: 100%;
				}
				
				#question {
					padding-left: 3%;
					padding-right: 3%;
					padding-top: 10px;
					z-index: 100;
					position: absolute;
					width: 100%;
					background-color: rgb(249, 249, 249);
				}
				
				#img {
					padding-left: 3%;
					padding-right: 3%;
					padding-top: 10px;
					z-index: 99;
					width: 100%;
					position: absolute;
				}
				
				.question {
					font-size: 20px;
					text-align: start;
					text-indent: -30px;
					margin-left: 2rem;
				}
				
				.answerBox {
					text-align: start;
					margin-left: 2rem;
				}
				
				.answerBox label {
					font-size: 15px;
					margin-left: 5px;
				}
				
				.answer {
					height: 15px;
					width: 15px;
					position: relative;
					top: 3px;
				}
				
				.button_box {
					width: 100%;
					margin-top: 15px;
					margin-bottom: 15px;
					text-align: center;
				}
				
				.form_box {
					display: inline-block;
					width: 100%;
					text-align: center;
				}
				
				.el-row {
					margin-top: 10px;
					margin-bottom: 10px;
				}
				
				#message,
				#evaluation,
				#request,
				#final {
					height: 100%;
					width: 100%;
					margin: 0px 20px;
				}
				
				html {
					margin: 0;
					padding: 0;
				}
				
				body {
					font-family: "Microsoft Yahei";
					font-size: 12px;
					margin: 0;
					padding: 0;
					width: 100%;
					height: 100%;
				}
				
				ul {
					padding: 0;
					margin: 0;
				}
				
				ul li {
					list-style-type: none;
				}
				
				a {
					text-decoration: none;
				}
				
				a:hover {
					text-decoration: none;
					color: #f00;
				}
				
				.clear {
					clear: both;
					height: 0;
					overflow: hidden;
				}
				
				.htop {
					width: 720px;
					height: 30px;
					margin: 30px auto 0px;
					border-left: 1px solid #ccc;
					border-right: 1px solid #ccc;
				}
				
				.bt {
					width: 800px;
					height: 40px;
					margin: 0px auto;
				}
				
				.bt .zuo {
					width: 40px;
					height: 40px;
					border-top: 1px solid #ccc;
					float: left
				}
				
				.bt .zj {
					width: 718px;
					height: 40px;
					font-size: 18px;
					font-weight: bold;
					text-align: center;
					float: left
				}
				
				.bt .you {
					width: 40px;
					height: 40px;
					border-top: 1px solid #ccc;
					float: right
				}
				
				.htx {
					width: 720px;
					height: 60px;
					margin: 0px auto;
					font-size: 14px;
				}
				
				.htx p {
					height: 30px;
					margin: 0px auto;
					text-align: center;
				}
				
				.huizi {
					font-size: 12px;
					color: #ccc;
				}
				
				.lmain {
					width: 720px;
					height: auto;
					margin: 0px auto;
					margin-bottom: 20px;
				}
				/*.lmain .xxdh{ width:720px;; height:23px; font-size:14px; margin:0px; padding:0px; border-top:1px solid #000;  border-right:1px solid #000; border-bottom:0px; border-left:1px solid #000;border: 1px solid #0a0a0a;}*/
				/*.lmain table{ width:720px; border:solid #000; border-width:1px 0px 0px 1px;}*/
				/*.lmain td{ height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;}*/
				
				.cang {
					width: 720px;
					height: 500px;
					margin: 0px auto;
					position: relative;
					top: 5px;
					overflow-y: auto;
					overflow-x: hidden;
				}
				
				.cang .shai {
					width: 100%;
					height: 110px;
					background-color: #e7ebee;
				}
				
				.cang .shai .czuo {
					width: 322px;
					height: 90px;
					float: left;
					border-right: 1px solid #000;
					margin-top: 10px;
				}
				
				.cang .shai .czuo p {
					margin-top: 0px;
					margin-left: 5px;
					height: 10px;
					text-align: left;
					font-size: 14px
				}
				
				.cang .shai .cyou {
					width: 380px;
					height: 90px;
					float: left;
					margin-top: 10px;
				}
				
				.cang .shai .cyou p {
					margin-top: 0px;
					margin-left: 5px;
					height: 10px;
					text-align: left;
					font-size: 14px
				}
				
				.cang .xlist {
					width: 100%;
					height: 390px;
					margin: 0px auto;
				}
				
				.cang .xlist ul {
					margin: 0px;
					padding: 0px;
				}
				
				.cang .xlist ul li {
					width: 100%;
					min-height: 20px;
					height: 100%;
					border-bottom: 1px solid #ccc;
					line-height: 30px;
				}
				
				.cang .xlist ul li:hover {
					background-color: #CCC;
					cursor: pointer
				}
				
				.professionIndex {
					border-radius: 50%;
					height: 20px;
					width: 20px;
					display: inline-block;
					background: #238ff9;
					vertical-align: top;
				}
				
				#hxz {
					width: 40px;
					height: 40px;
					line-height: 40px;
					padding-top: 5px;
					margin: 0px;
					float: left;
					text-align: center
				}
				
				#hdh {
					width: 80px;
					height: 40px;
					padding-top: 5px;
					margin: 0px;
					float: left;
				}
				
				#hmc {
					width: 300px;
					min-height: 40px;
					text-align: center;
					line-height: 20px;
					margin: 0px;
					padding: 10px;
					float: left
				}
				
				#hzdf {
					width: 130px;
					height: 40px;
					padding-top: 5px;
					margin: 0px;
					padding-left: 10px;
					float: left
				}
				
				#hln {
					width: 80px;
					height: 20px;
					padding-top: 5px;
					margin: 0px;
					float: right
				}
				
				.seachSchool {
					color: #C00;
					cursor: pointer
				}
				
				.seachSchoolOut {
					cursor: pointer
				}
			</style>
			<!--<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts-all-3.js"></script>-->
			<!--<script src="${request.contextPath}/statics/libs/echarts.js?_${.now?long}"></script>-->
	</head>

	<body>
		<div id="app" style="background-color: #F9F9F9;height: 100%;width: 100%;">
			<div v-show="step == 0">
				<div class="grid-btn">
					<div class="form-group col-sm-2">
						<input type="text" class="form-control" v-model="nameSearch" @keyup.enter="query" placeholder="学生名字">
					</div>
					<a class="btn btn-default" @click="query">查询</a>
					<a class="btn btn-default" @click="deleteRows">删除</a>
				</div>
				<div id="export_word">
					<table id="jqGrid"></table>
					<div id="jqGridPager"></div>
				</div>
			</div>
		</div>

		<script>
			function view(id) {
				//alert(id)
				window.open(baseURL + "modules/gaokao/student.html?id=" + id);
			}

			function copy(id) {
				var Url2 = window.location.origin + "/gaokao-admin/modules/gaokao/student.html?id=" + id;
				var oInput = document.createElement('input');
				oInput.value = Url2;
				document.body.appendChild(oInput);
				oInput.select(); // 选择对象
				document.execCommand("Copy"); // 执行浏览器复制命令
				oInput.className = 'oInput';
				oInput.style.display = 'none';
				alert('复制成功');
			}

			$(function() {
				$("#jqGrid").jqGrid({
					url: baseURL + 'gaokaobaobei/userbackup/getSelfStudentlist',
					datatype: "json",
					postData: {
						expertVisible: 1,
					},
					colModel: [{
							label: '姓名',
							name: 'name',
							index: 'name',
							width: 80
						},
						{
							label: '考号',
							name: 'candidateNumber',
							index: 'candidate_number',
							width: 150
						},
						{
							label: '文理',
							name: 'wlProperty',
							index: 'wl_property',
							width: 80
						},
						{
							label: '本专',
							name: 'benzhuan',
							index: 'benzhuan',
							width: 80
						},
						{
							label: '分数',
							name: 'score',
							index: 'score',
							width: 80
						},
						{
							label: '毕业高中',
							name: 'highSchool',
							index: 'high_school',
							width: 80
						},
						{
							label: '联系电话',
							name: 'phone',
							index: 'phone',
							width: 80
						},
						{
							label: '操作',
							name: 'cz',
							index: 'cz',
							width: 80,
							formatter: function(data, a, rows) {
								return '<button class="label label-success" onclick="view(\'' + rows.id + '\')">查看</button><button class="label label-default" onclick="copy(\'' + rows.id + '\')">复制</button>';
							}
						},
						{
							label: '操作',
							name: 'cz',
							index: 'cz',
							width: 80,
							formatter: function(data, a, rows) {
								return '<button class="label label-success" onclick="app.gotoDesign(\'' + rows.id + '\')">设计志愿</button>';
							}
						}
					],
					viewrecords: true,
					height: 385,
					rowNum: 10,
					rowList: [10, 30, 50],
					rownumbers: false,
					rownumWidth: 25,
					autowidth: true,
					multiselect: true,
					pager: "#jqGridPager",
					jsonReader: {
						root: "page.list",
						page: "page.currPage",
						total: "page.totalPage",
						records: "page.totalCount"
					},
					prmNames: {
						page: "page",
						rows: "limit",
						order: "order"
					},
					gridComplete: function() {
						//隐藏grid底部滚动条
						$("#jqGrid").closest(".ui-jqgrid-bdiv").css({
							"overflow-x": "hidden"
						});
					}
				});
			});
			var app = new Vue({
				el: '#app',
				data() {
					return {
						region: ['全部', '华北', '华东', '华中', '华南', '西南', '西北', '东北'],
						province: [],
						cities: [],
						nameSearch: "",
						step: 0,
						number: "",
						wenli: [{
							value: '文科',
							name: '文科'
						}, {
							value: '理科',
							name: '理科'
						}],
						benzhuan: [{
							value: '本科',
							name: '本科'
						}, {
							value: '专科',
							name: '专科'
						}],
						nature: [{
							value: '艺术型',
							label: '艺术型'
						}, {
							value: '传统型',
							label: '传统型'
						}, {
							value: '管理型',
							label: '管理型'
						}, {
							value: '研究型',
							label: '研究型'
						}, {
							value: '现实型',
							label: '现实型'
						}, {
							value: '社会型',
							label: '社会型'
						}],
						student: {
							wlProperty: "",
							type: "等待审核",
							nature1: "",
							region: "",
							province: "",
							city: "",
							benzhuan: "",
						},
						active: 0,
					};
				},
				mounted() {},
				methods: {
					deleteRows: function() {
						var selectedIds = $("#jqGrid").jqGrid("getGridParam", "selarrrow");
						$.ajax({
							type: "POST",
							url: baseURL + 'gaokaobaobei/userbackup/delete',
							contentType: "application/json",
							data: JSON.stringify(selectedIds),
							success: function(r) {
								if(r.code != 0) {
									alert("删除失败")
								} else {
									alert("删除成功")
									app.reload()
								}
							}
						});
					},
					gotoDesign: function(id) {
						if(id != null && id != undefined && id != "") {
							$.ajax({
								type: "GET",
								url: baseURL + 'gaokaobaobei/userbackup/getUserBackupByStudentId?id=' + parseInt(id),
								contentType: "application/json",
								success: function(r) {
									app.student = r.student
									app.student.expertVisible = 1
									localStorage.setItem("id", parseInt(id))
									localStorage.setItem("name", app.student.name)
									localStorage.setItem("card", app.student.candidateNumber)
									localStorage.setItem("school", app.student.highSchool)
									localStorage.setItem("score", app.student.score)
									localStorage.setItem("wenlike", app.student.wlProperty)
									localStorage.setItem("studentPhone", app.student.phone)
									localStorage.setItem("benzhuan",app.student.benzhuan)
									localStorage.setItem("nature",app.student.nature)
									localStorage.setItem("region",app.student.region)
									localStorage.setItem("city",app.student.city)
									localStorage.setItem("province",app.student.province)
									localStorage.setItem("wantToDoRequest",app.student.wantToDoRequest)
									localStorage.setItem("remarks",app.student.remarks)
									parent.location.href = baseURL+"index.html#modules/gaokao/desigin.html"
									//									nature1,region,province,city,wantToDoRequest,remarks
								}
							});
						}
					},
					query: function() {
						app.reload()
					},
					reload: function(event) {
						var page = $("#jqGrid").jqGrid('getGridParam', 'page');
						$("#jqGrid").jqGrid('setGridParam', {
							postData: {
								'search': app.nameSearch
							},
							page: page
						}).trigger("reloadGrid");
					},
				}
			});
		</script>
	</body>

</html>